]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
MessageTray: restore opacity when expanding a notification
authorGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 19 Nov 2012 17:59:39 +0000 (18:59 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 19 Nov 2012 18:20:31 +0000 (19:20 +0100)
MessageTray tweens both opacity and y to hide or show _notificationWidget,
but only y when expanding it. This means that an existing tween to hide
the notification will continue running, clearing the notification state.
If the hiding one completes before the showing one, the onComplete handler
will throw an exception (because the notification was nullified) and
therefore break the state tracking.

https://bugzilla.gnome.org/show_bug.cgi?id=683986

js/ui/messageTray.js

index 50fd3b4ea38c3bdf960024f52e0910f23f831e70..d69d31b9b611dde96b03213aef5b2f5748c29883 100644 (file)
@@ -2403,8 +2403,13 @@ const MessageTray = new Lang.Class({
         if (this._notificationWidget.y < expandedY) {
             this._notificationWidget.y = expandedY;
         } else if (this._notification.y != expandedY) {
+            // Tween also opacity here, to override a possible tween that's
+            // currently hiding the notification. This will ensure that the
+            // notification is not removed when the onComplete handler for this
+            // one triggers.
             this._tween(this._notificationWidget, '_notificationState', State.SHOWN,
                         { y: expandedY,
+                          opacity: 255,
                           time: ANIMATION_TIME,
                           transition: 'easeOutQuad'
                         });